﻿<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" lasteditedby="Geert" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
  <title translate="true">Deferring validation</title>
  <keywords>
    <keyword translate="true">Validation</keyword>
  </keywords>
  <body>
    <header>
      <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Deferring validation</text></para>
    </header>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">The opinions about validation differ from person to person. Some people think it is best practice to immediately show the errors to the users. Others want to defer it to the moment where the user clicks the </text><text styleclass="Normal" style="font-style:italic;" translate="true">Save</text><text styleclass="Normal" style="font-style:normal;" translate="true"> or </text><text styleclass="Normal" style="font-style:italic;" translate="true">OK</text><text styleclass="Normal" style="font-style:normal;" translate="true"> button. Catel supports both &quot;best practices&quot;.</text></para>
    <para styleclass="Normal"><text styleclass="Normal" style="font-style:normal;" translate="true">Below is a table of properties that can be used to affect the validation deferring.</text></para>
    <para styleclass="Normal"><table styleclass="Default" rowcount="3" colcount="3">
      <tr style="vertical-align:top">
        <td style="width:268px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Property</text></para>
        </td>
        <td style="width:169px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Validate immediately</text></para>
        </td>
        <td style="width:180px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Defer to a later moment</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:268px;">
          <para styleclass="Normal (list)"><link displaytype="text" defaultstyle="true" type="topiclink" href="P_Catel_MVVM_ViewModelBase_DeferValidationUntilFirstSaveCall" styleclass="Normal (list)" translate="true">DeferValidationUntilFirstSaveCall</link></para>
        </td>
        <td style="width:169px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" translate="true">false</text></para>
        </td>
        <td style="width:180px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" translate="true">true</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:268px;">
          <para styleclass="Normal (list)"><link displaytype="text" defaultstyle="true" type="topiclink" href="P_Catel_MVVM_ViewModelBase_ValidateModelsOnInitialization" styleclass="Normal (list)" translate="true">ValidateModelsOnInitialization</link></para>
        </td>
        <td style="width:169px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" translate="true">true</text></para>
        </td>
        <td style="width:180px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" translate="true">false</text></para>
        </td>
      </tr>
    </table></para>
    <para styleclass="Notes"><text styleclass="Notes" translate="true">If the </text><link displaytype="text" defaultstyle="true" type="topiclink" href="P_Catel_MVVM_ViewModelBase_DeferValidationUntilFirstSaveCall" styleclass="Notes" translate="true">DeferValidationUntilFirstSaveCall</link><text styleclass="Notes" translate="true"> property, is used, it must be set as first property in the view model because the validation kicks in immediately when properties change.</text></para>
  </body>
</topic>
